<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
		<%
	request.setAttribute("serverPath",request.getScheme()      
            +"://"     
            + request.getServerName()      
            + ":" + request.getServerPort()+request.getContextPath()+"/");	
	%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>信息管理系统</title>
<%@ include file="/web/common.jsp" %> 
<script type="text/javascript"> 
	var fntCallback = function(retText) { 
	   		$('retXmlData').value=retText;
	 };
	var sendData = function(){		
		$('retXmlData').value = '正在等待服务响应...';
		var method = $('method').value;
		var url = $('urlMsg').value;
		var p={
			data :$('sendXmlData').value
		}
		if(method=='GET')p={};

		Ext.Ajax.request( {
			url :url,
			headers : { Accept:'application/json' },
			method : method,
			jsonData : p.data,
			callback : function(options, success, response) {
				fntCallback(response.responseText);
			}
		});
	}
</script>
<style type="text/css">
</style>
</head>

<body style="padding: 5px;">
	请求地址:<input id="urlMsg" name="urlMsg" value="${serverPath }" style="width: 90%;margin-bottom: 10px;"/><br />
	<select id="method" name="method">
		<option value="GET" selected="selected">GET</option>
		<option value="POST">POST</option>
		<option value="PUT">PUT</option>
		<option value="DELETE">DELETE</option>
	</select>
	<input type="button" value=" 提交 " onclick="sendData()" style="height: 30px;width: 80px; "/><br />
	
	<textarea id="sendXmlData" name="sendXmlData" style="width: 70%" rows="20">这里...贴入要发送的内容</textarea>
	<textarea id="retXmlData" name="retXmlData" style="width: 28%" rows="20">这里...显示服务器返回结果</textarea>

</body>
</html>